<template>
  <div class="page-header-index-wide">
    <div>
      <div class="account-settings-info-left" v-if="!disPLAY_none">
        <a-menu
          mode="horizontal"
          :selectedKeys="selectedKeys"
          type="inner"
          @openChange="onOpenChange"
          style="padding: 8px 16px 0"
        >
          <!-- <a-card
            :bordered="false"
            :bodyStyle="{ padding: '16px', height: '100%' }"
            :style="{ height: '100%' }"
          >-->
          <a-menu-item key="/educationalCenter/studentExpand/list" class="border-cantainer">
            <router-link :to="{ name: 'student_list' }">
              <div class="border_catainer_bottom">学员管理</div>
            </router-link>
          </a-menu-item>
          <a-menu-item key="/educationalCenter/studentExpand/student_sign_info_list" class="border-cantainer">
            <router-link :to="{ name: 'student_sign_info_list' }">
              <div class="border_catainer_bottom">报读情况</div>
            </router-link>
          </a-menu-item>
          <!-- </a-card> -->
          <a-menu-item key="/educationalCenter/studentExpand/sendMessage" class="border-cantainer" v-if="false">
            <router-link :to="{ name: 'student_sendMessage' }">
              <div class="border_catainer_bottom">发送信息</div>
            </router-link>
          </a-menu-item>
          <a-menu-item key="/educationalCenter/studentExpand/studentInfo" class="border-cantainer" v-if="false">
            <router-link :to="{ name: 'student_Info' }">
              <div class="border_catainer_bottom">学员信息</div>
            </router-link>
          </a-menu-item>
          <!-- <a-menu-item key="/educationalCenter/studentExpand/changeImportHour" class="border-cantainer" v-if="false">
            <router-link :to="{ name: 'change_import_hour' }">
              <div class="border_catainer_bottom">修正剩余课时</div>
            </router-link>
          </a-menu-item>
          <a-menu-item key="/educationalCenter/studentExpand/batchClearCourseHour" class="border-cantainer" v-if="false">
            <router-link :to="{ name: 'batch_clear_course_hour' }">
              <div class="border_catainer_bottom">批量课时清零</div>
            </router-link>
          </a-menu-item> -->
        </a-menu>
      </div>
      <div :class="disPLAY_none == true ? '' : 'quittanceChildren'">
        <route-view></route-view>
      </div>
    </div>
  </div>
</template>

<script>
import { PageView, RouteView } from '@/layouts'
import { mixinDevice } from '@/utils/mixin.js'

export default {
  components: {
    RouteView,
    PageView,
  },
  mixins: [mixinDevice],
  data() {
    return {
      // horizontal  inline
      mode: 'inline',

      openKeys: [],
      selectedKeys: [],
      disPLAY_none: false,
      // cropper
      preview: {},
      option: {
        img: '/avatar2.jpg',
        info: true,
        size: 1,
        outputType: 'jpeg',
        canScale: false,
        autoCrop: true,
        // 只有自动截图开启 宽度高度才生效
        autoCropWidth: 180,
        autoCropHeight: 180,
        fixedBox: true,
        // 开启宽度和高度比例
        fixed: true,
        fixedNumber: [1, 1],
      },

      pageTitle: '',
    }
  },
  mounted() {
    this.updateMenu()
  },
  methods: {
    onOpenChange(openKeys) {
      this.openKeys = openKeys
    },
    updateMenu(to) {
      const routes = this.$route.matched.concat()
      this.selectedKeys = [routes.pop().path]
      if (
        this.selectedKeys[0] == '/educationalCenter/addCourse' ||
        this.selectedKeys[0] == '/educationalCenter/studentExpand/studentInfo'||
        this.selectedKeys[0] == '/educationalCenter/studentExpand/changeImportHour'||
        this.selectedKeys[0] == '/educationalCenter/studentExpand/batchClearCourseHour'||
        this.selectedKeys[0] == '/educationalCenter/studentExpand/sendMessage'
      ) {
        this.disPLAY_none = true
      } else {
        this.disPLAY_none = false
      }
    },
  },
  watch: {
    $route(val) {
      this.updateMenu()
    },
  },
}
</script>

<style lang="less">
.border-cantainer {
  padding: 0 10px;
  margin-right: 40px;
}
</style>
